circles = (1001 + 1) // 2
res = 1
sum_per_circle = lambda x: 16 * (x ** 2) + 16 - 28 * x
for i in range(2, circles + 1):
    res += sum_per_circle(i)
print(res)